class Maybe {
    constructor(_value) {
        this._value = _value
    }
    static of(_value) {
        return new Maybe(_value)
    }
    map(fn) {
        return this.isNothing() ? Maybe.of(this._value) : Maybe.of(fn(this._value))
    }
    isNothing() {
        return this._value == undefined || this._value == null
    }
}

class Container {
    constructor(_value) {
        this._value = _value
    }
    static of(_value) {
        return new Container(_value)
    }
    map(fn) {
        return Container.of(fn(this._value))
    }
}

module.exports = { Maybe, Container }